Changing Existing Test to Bold

Hi

To make a Big table more readable , i want to make alternate rows as bold and normal.

i have written piece of DXL.Please guide me on how to format object text as BOLD

Object rowHead
Object cell
bool a=false
for rowHead in table current Object do
{
if(a==true)
{
a=false
continue
}
a=true

for cell in row rowHead do
{

// What to do here..Help Required here
}
print "\n"
}
Satbir - Tue Oct 05 07:03:35 EDT 2010

Re: Changing Existing Text to Bold
Satbir - Tue Oct 05 07:07:46 EDT 2010

its Tex not Test ,Sorry of typo

Re: Changing Existing Text to Bold
Satbir - Tue Oct 05 07:07:53 EDT 2010

its Text not Test ,Sorry of typo

Re: Changing Existing Test to Bold
llandale - Wed Oct 06 16:32:20 EDT 2010

This is rather tricky and I have not tried it, but here goes.

The problem is figuring out what attribute is actually being displayed in the table, and if its of type 'text' then go ahead and bold the results. I see there is undocumeted perm
AttrDef mainColumnAttribute(Object) that seems to work when 'Object' is some object in a table, and returns the AttrDef of the currently displayed value.

Never dealt with table attributes before, but the following works. Select your table, open its properties, and change the displayed Attribute from 'main' to 'Object Text'. Set values, and run the following:

Object oTable = getTable(current Object)
if (null oTable)        halt
        //print "ad:\n"
AttrDef ad = mainColumnAttribute(oTable)
if (null ad)                    halt
        //print "type:\n"
if (ad.typeName "" != "Text")       halt
 
Object rowHead
Object cell
string NameAttr = ad.name
   print "Display attr in table: '" NameAttr "'\n"
bool DoBold = true
string Value = ""
 
 
for rowHead in oTable do
{
   DoBold = !DoBold
 
   for cell in row rowHead do
   {
        if (isDeleted(cell )                                    and
            length(doorsInfo(infoVersion)) >=7               and 
            (doorsInfo(infoVersion))[0:6] == "9.2.0.1")       continue        // DOORS version 9.2.0.1 bug
 
      Value = probeAttr_(cell, NameAttr)   // Raw text value
      if (DoBold) //
      then cell.NameAttr = richText("{\\b " Value "}")  // Set Rich Bold
      else cell.NameAttr = Value             // Possibly erase existing Bold
   }
}


It gets more complicated when you change the 'view' to display a different attribute than the table attribute; hopefully someone with experience will chime in here.

 

 

  • Louie